package com.example.ibsp_demo.pojo.entity.content;

import java.time.LocalDateTime;

public class Like {
    private Integer likeId;
    private Integer likerId;
    private Integer ctid;
    private Integer commentId; // 新增：评论ID（用于区分是内容点赞还是评论点赞）
    private LocalDateTime likeTime;

    // 无参构造函数
    public Like() {
    }

    // 有参构造函数（包含新增的commentId）
    public Like(Integer likeId, Integer likerId, Integer ctid, Integer commentId, LocalDateTime likeTime) {
        this.likeId = likeId;
        this.likerId = likerId;
        this.ctid = ctid;
        this.commentId = commentId; // 新增字段初始化
        this.likeTime = likeTime;
    }

    // Getter 和 Setter 方法（新增commentId的对应方法）
    public Integer getLikeId() {
        return likeId;
    }

    public void setLikeId(Integer likeId) {
        this.likeId = likeId;
    }

    public Integer getLikerId() {
        return likerId;
    }

    public void setLikerId(Integer likerId) {
        this.likerId = likerId;
    }

    public Integer getCtid() {
        return ctid;
    }

    public void setCtid(Integer ctid) {
        this.ctid = ctid;
    }

    // 新增commentId的Getter和Setter
    public Integer getCommentId() {
        return commentId;
    }

    public void setCommentId(Integer commentId) {
        this.commentId = commentId;
    }

    public LocalDateTime getLikeTime() {
        return likeTime;
    }

    public void setLikeTime(LocalDateTime likeTime) {
        this.likeTime = likeTime;
    }

    // 优化的 toString 方法（包含新增的commentId）
    @Override
    public String toString() {
        return "TLike{" +
                "likeId=" + likeId +
                ", likerId=" + likerId +
                ", ctid=" + ctid +
                ", commentId=" + commentId + // 新增字段输出
                ", likeTime=" + likeTime +
                '}';
    }
}